//
//  ZXBuyNongjiViewController.m
//  demo
//
//  Created by maxine on 2016/11/13.
//  Copyright © 2016年 maxine. All rights reserved.
//

#import "ZXBuyNongziViewController.h"
#import "ZXWeiKaiTongAlertView.h"


@interface ZXBuyNongziViewController ()
@property (strong, nonatomic) IBOutlet UIView *topView;
@property (weak, nonatomic) IBOutlet UIButton *oneButton;
@property (weak, nonatomic) UIButton *selectBtn;

@property (strong, nonatomic) UIView *lineView;

@end

@implementation ZXBuyNongziViewController
- (IBAction)btnClick:(UIButton *)sender {
    
    self.selectBtn.selected = NO;
    sender.selected = YES;
    self.selectBtn = sender;

    
    
    self.selectBtn = sender;
    
    self.lineView.x = sender.x;
    
    
    ZXWeiKaiTongAlertView *alert = [[ZXWeiKaiTongAlertView alloc]init];
    alert.center = self.view.center;
    [self.view addSubview:alert];
    
    
    [self.view layoutIfNeeded];
    
}

- (IBAction)zhongziBtnClick:(UIButton *)sender {
    ZXWeiKaiTongAlertView *alert = [[ZXWeiKaiTongAlertView alloc]init];
    alert.center = self.view.center;
    [self.view addSubview:alert];
        
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.oneButton.selected = YES;
    self.selectBtn = self.oneButton;
    
    
    self.navigationItem.title = @"买农资";
    
    self.lineView.center = CGPointMake(self.selectBtn.center.x, 0) ;
    self.lineView = [[UIView alloc]initWithFrame:CGRectMake(20, 41, 80, 2)];
    
    self.lineView.backgroundColor = [UIColor colorWithRed:103/255.0 green:178/255.0 blue:69/255.0 alpha:1];
    [self.topView addSubview:self.lineView];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
